#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

const int N = 210;

struct E
{
    int id, a, b, c;

    bool operator< (const E &a) const
    {
        if (c != a.c)
            return c < a.c;
        return id < a.id;
    }
}e[N];

//priority_queue<E, vector<E>, cmp > q;

int n, x, y;

int main()
{
    cin >> n >> x >> y;
    for (int i = 0 ; i < n ; i ++)
    {
        int a, b, c;
        cin >> a >> b;
        c = pow((x - a), 2) + pow((y - b), 2);
        e[i] = {(i + 1), a, b, c};
    }

    sort(e, e + n);
    for (int i = 0 ; i < 3 ; i ++)
        cout << e[i].id << endl;

    return 0;
}
